﻿/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Javascript code for Gigya support in PBDesk.com (cms.PBDesk.com)
Author  : Pinal Bhatt
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

        // Create and Publish User's Action  
        // This method is associated with the "btnPublishAction" click  
        function showShareUI() {  
            // Constructing a UserAction Object  
            var act = new gigya.services.socialize.UserAction();  
  
            // Setting the default user message   
            // (will be presented as default text in the edit box on the Share UI)  
            act.setUserMessage("Your comment here...");  
  
            // Setting the title and description   
            // (will be presented in the preview on the Share UI)  
            act.setTitle(document.title);
            act.setDescription(getMetaContents("description"));  
  
            // Setting a link back to the publishing source  
           act.setLinkBack(window.location.href);  
  
            // Adding Action Link  
            act.addActionLink("Read this...", window.location.href);  
  
            // Adding a video (will be presented in the preview on the Share UI)  
            var image= {  
                src: 'http://sites.google.com/site/pinalbhatt/imgs/logo163x59.gif',  
                type: 'image',
	            href: window.location.href
            }  
            act.addMediaItem(image);  
  
            // Parameters for the showShareUI method, including the UserAction object  
            var shareParams =   
            {  
                userAction: act  // The UserAction object enfolding the newsfeed data.                                              
                ,onError: showShareUI_onError  // onError method will be summoned if an error occurs.   
                ,onSendDone: showShareUI_onSendDone // onError method will be summoned after   
                                    // Gigya finishes the publishing process.  
                                                      
                ,showMoreButton: true // Enable the "More" button and screen  
                ,showEmailButton: true // Enable the "Email" button and screen  
                ,useHTML: true  // Use the HTML implementation of the Plugin (rather then Flash implementation)  
  
            };  
  
            // Show the "Share" dialog  
            gigya.services.socialize.showShareUI(conf, shareParams);  
  
        }  
          
        // onError event handler  
        function showShareUI_onError(event) {  
            alert('An error has occured' + ': ' + event.errorCode + '; ' + event.errorMessage);  
        }  
  
        // onSendDone event handler.   
        // Displays in the status field, the list of providers to which the newsfeed has been   
        // successfully published.  
        function showShareUI_onSendDone(event)  
        {  

        }  